<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="css/base.css">
    <link rel="stylesheet" href="css/fontsize.css">
    <link rel="stylesheet" href="css/bootstrap.min.css">
    <script src="./js/jQuery.min.js"></script>
    <script src="./js/bootstrap.min.js"></script>
    <link rel="stylesheet" href="css/swiper.min.css">
    <script src="js/swiper-bundle.min.js"></script>
    <link  rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/4.1.1/animate.min.css"/>
    <link rel="shortcut icon" href="./bitbug_favicon.ico" />
</head>
<body>
  
    <div class="header">
        <ul class="nav">
            <li class="nav-item">
              <a class="nav-link active" href="./index.html">home</a>
            </li>
            <li class="nav-item">
              <a class="nav-link" href="./egg.html">We</a>
            </li>
            <li class="nav-item">
              <a class="nav-link" href="./like.html">Like</a>
            </li>
     
          </ul>
          <div class="showTime"></div>
      
    </div>
</body>
<style>
.showTime{
    position: absolute;
    right:0;
    top: 0;
    font-size: 7px;
    color: pink;
}

     .header{
    height: 2.5rem;
    background-color: plum;
   }
   .nav-item a{
    color: white !important;
   }
 
   .nav-item a:hover{
    color:green !important;
   }
</style>
<script>
    var t = null;
    t = setTimeout(time, 1000);//開始运行
    function time() {
        clearTimeout(t);//清除定时器
        dt = new Date();
        var y = dt.getFullYear();
        var mt = dt.getMonth() + 1;
        var day = dt.getDate();
        var h = dt.getHours();//获取时
        var m = dt.getMinutes();//获取分
        var s = dt.getSeconds();//获取秒
        document.querySelector(".showTime").innerHTML =  y + "年" + mt + "月" + day + "日" + h + ":" + m + ":" + s;
        t = setTimeout(time, 1000); //设定定时器，循环运行     
    }
</script> 
</html>